import java.util.List;

import com.googlecode.edacious.Edacious;
import com.googlecode.edacious.EdaciousException;
import com.googlecode.edacious.EdaciousFactory;
import com.googlecode.edacious.Measure;
import com.googlecode.edacious.MeasureGroup;
import com.googlecode.edacious.User;


public class test {

	private static final String EMAIL = "james.p.edwards42@gmail.com";
	private static final String PASS = "!33th4ck3r";
	

	public static void main(String[] args) throws EdaciousException {
		Edacious edaciousLib = EdaciousFactory.getInstance();
		String hash = edaciousLib.getHash(EMAIL, PASS);
		List<User> users = edaciousLib.getUsers(EMAIL, hash);
		for (User user : users) {
			List<MeasureGroup> measureGroups = edaciousLib.getMeasureGroups(user.getId(), user.getPublicKey());
			System.out.println(user.getShortname());
			for (MeasureGroup mGroup : measureGroups) {
				for (Measure m : mGroup.getMeasures()) {
					System.out.println(m);
				}
				System.out.println("\n");
			}
			
		}
	}

}
